package com.example.zluserservice.dto.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @Author zhenliu（孙凌岳）
 * @Description AI生成-资源响应DTO
 * @Date 2025/6/15 19:38
 * @Version 1.0
 */
@Data
@NoArgsConstructor
@ApiModel(description = "资源响应DTO")
public class ResourceResDTO {
    @ApiModelProperty(value = "资源编号")
    private String resourceNo;

    @ApiModelProperty(value = "父资源编号")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private String parentResourceNo;

    @ApiModelProperty(value = "资源名称")
    private String resourceName;

    @ApiModelProperty(value = "资源类型：s平台 c目录 m菜单 r按钮")
    private String resourceType;

    @ApiModelProperty(value = "请求地址")
    private String requestPath;

    @ApiModelProperty(value = "权限标识")
    private String label;

    @ApiModelProperty(value = "排序")
    private Integer sortNo;

    @ApiModelProperty(value = "图标")
    private String icon;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "列表选择：选中Ids")
    private String[] checkedIds;

    @ApiModelProperty(value = "TREE结构：选中资源编号")
    private String[] checkedResourceNos;

    @ApiModelProperty(value = "角色查询资源：资源对应角色id")
    private String roleId;

    @ApiModelProperty(value = "层级")
    private Integer level = 4;

    @ApiModelProperty(value = "主键")
    private Long id;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")//get
    protected LocalDateTime createTime;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")//get
    protected String createDay;

    @ApiModelProperty(value = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")//get
    protected LocalDateTime updateTime;

    @ApiModelProperty(value = "创建者:username")
    private Long createBy;

    @ApiModelProperty(value = "更新者:username")
    private Long updateBy;

    @ApiModelProperty(value = "是否有效")
    protected String dataState;

    @ApiModelProperty(value = "创建人类型 1 前台 2后台")
    private Integer createType;

    @ApiModelProperty(value = "创建人名称")
    private String creator;

    @ApiModelProperty(value = "后台管理端创建人名称")
    private String adminCreator;

    @ApiModelProperty(value = "更新人名称")
    private String updater;

    @Builder
    public ResourceResDTO(String resourceNo, String parentResourceNo, String resourceName, String resourceType, String requestPath, String label, Integer sortNo, String icon, String remark, String[] checkedIds, String[] checkedResourceNos, String roleId, Integer level, Long id, LocalDateTime createTime, String createDay, LocalDateTime updateTime, Long createBy, Long updateBy, String dataState, Integer createType, String creator, String adminCreator, String updater) {
        this.resourceNo = resourceNo;
        this.parentResourceNo = parentResourceNo;
        this.resourceName = resourceName;
        this.resourceType = resourceType;
        this.requestPath = requestPath;
        this.label = label;
        this.sortNo = sortNo;
        this.icon = icon;
        this.remark = remark;
        this.checkedIds = checkedIds;
        this.checkedResourceNos = checkedResourceNos;
        this.roleId = roleId;
        this.level = level;
        this.id = id;
        this.createTime = createTime;
        this.createDay = createDay;
        this.updateTime = updateTime;
        this.createBy = createBy;
        this.updateBy = updateBy;
        this.dataState = dataState;
        this.createType = createType;
        this.creator = creator;
        this.adminCreator = adminCreator;
        this.updater = updater;
    }
}
